<!--
 * createor: zc
 * email: zc8023zs@163.com
 * create_time: 2020/3/14 13:46:24
 *-->
<template>
  <el-container>
    <el-header>
      系统参数配置详情
    </el-header>
    <el-main>
      <el-form label-width="200px" :inline="true" style="padding:5% 5% 0 5%">
        <el-form-item label="自增主键：">
          <span>{{formData.id}}</span>
        </el-form-item>
        <el-form-item label="父级id：">
          <span>{{formData.pid}}</span>
        </el-form-item>
        <el-form-item label="分类名称：">
          <span>{{formData.class_name}}</span>
        </el-form-item>
        <el-form-item label="分类标识：">
          <span>{{formData.name}}</span>
        </el-form-item>
        <el-form-item label="数值参数：">
          <span>{{formData.number_value}}</span>
        </el-form-item>
        <el-form-item label="日期参数：">
          <span>{{formData.date_value}}</span>
        </el-form-item>
        <el-form-item label="日期参数：">
          <span>{{formData.time_value}}</span>
        </el-form-item>
        <el-form-item label="字符参数：">
          <span>{{formData.string_value}}</span>
        </el-form-item>
        <el-form-item label="备注：">
          <span>{{formData.remark}}</span>
        </el-form-item>
        <el-form-item label="1=默认 0=非默认：">
          <span>{{formData.init_default}}</span>
        </el-form-item>
        <el-form-item label="数据版本字段：">
          <span>{{formData.version_id}}</span>
        </el-form-item>
      </el-form>
    </el-main>
  </el-container>
</template>
<style scoped>
body .app-container .el-container,
body .app-container .el-header,
body .app-container .el-main,
body .el-container,
body .el-header,
body .el-main {
  padding: 0;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}
</style>
<script>
import { Loading } from "element-ui";
import {
  qr_sys_paramsInfo
} from '@/api/project/wmyw/project_wmyw_qr_sys_params'
export default {
  name: "a_wmywa_qr_sys_params_info",
  data() {
    return {
      infoLoading: false,
      formData:{
        id: 0, 
        pid: 0, 
        class_name: '', 
        name: '', 
        number_value: 0.0, 
        date_value: '2020/8/11 15:00:36', 
        time_value: '2020/8/11 15:00:36', 
        string_value: '', 
        remark: '', 
        init_default: 0, 
        version_id: 0, 
      }
    };
  },
  activated() {
    var result = location.search.match(new RegExp("[\?\&]id=([^\&]+)", "i"));
    if(result != null || result.length > 0){
      this.onInfo(result[1]);
    }
  },
  methods: {
    onInfo(id){
      this.infoLoading=true;
      qr_sys_paramsInfo({id:id}).then(r=>{
        this.formData.id = r.dataSingle.id, 
        this.formData.pid = r.dataSingle.pid, 
        this.formData.class_name = r.dataSingle.class_name, 
        this.formData.name = r.dataSingle.name, 
        this.formData.number_value = r.dataSingle.number_value, 
        this.formData.date_value = r.dataSingle.date_value, 
        this.formData.time_value = r.dataSingle.time_value, 
        this.formData.string_value = r.dataSingle.string_value, 
        this.formData.remark = r.dataSingle.remark, 
        this.formData.init_default = r.dataSingle.init_default, 
        this.formData.version_id = r.dataSingle.version_id, 
        this.infoLoading=false;
      }).catch(()=>{
        this.infoLoading=false;
      });
    }
  }
}
</script>
